<?php

abstract class LogFactory {
	protected static $instance = null;
	protected $log = null;
	protected $config = array();
	
	protected function __construct() {
		$this->loadLogConfig();
	}
	
	public static function getInstance() {
		return null;
	}
	
	public function __clone() {
		throw new Exception('deny Clone.');
	}
	
	public function getLog() {
		if (!$this->log) {
			require_once 'Zend/Log.php';
			$this->log = new Zend_Log();
			$this->log->addWriter($this->getLogWriter());
			
			$filter = new Zend_Log_Filter_Priority($this->config['filterPriority']);
			$this->log->addFilter($filter);
		}
		return $this->log;
	}
	
	abstract protected function loadLogConfig();
	
	abstract protected function getLogWriter();
}
